﻿// test_12.2.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int* cp(int*pa,int m)
{
	int max = *pa;
	int min = *pa;
	int sum = 0;
	for (int i = 0;i < m;i++)
	{
		if (max <= *(pa + i))
		{
			max = *(pa + i);
		}
	}
	for (int j = 0;j < m;j++)
	{
		if (min >= *(pa + j))
		{
			min = *(pa + j);
		}
	}
	for (int z = 0;z < m;z++)
	{
		sum += *(pa + z);
	}
	int arr[3] = { max,min,sum };
	int* pb = arr;
	return pb;
	
	

}
int* div(int* p, int n)
{
	int a = 0;
	int b = 0;
	int c = 0;
	int d = 0;
	int e = 0;
	for (int i = 0;i < n;i++)
	{
		switch (*(p + i) / 10)
		{
		case 10:
			a += 1;
			break;
		case 9:
			a += 1;
			break;
		case 8:
			b += 1;
			break;
		case 7:
			c += 1;
			break;
		case 6:
			d += 1;
			break;
		default:
			e += 1;
			break;
		}
	}
	int arr[5] = { a,b,c,d,e };
	int* pc = arr;
	return pc;
		
}

	int main()
{
	int n = 0;
	scanf("%d", &n);
	int arr[100] = { 0 };
	for (int i = 0;i < n;i++)
	{
		scanf("%d", &arr[i]);

	}
	int *p=cp(arr, n);
	printf("max=%d,min=%d,ave=%d\n", *p, *(p + 1), *(p + 2)/n);
	int*pd=div(arr, n);
	printf("%d %d %d %d %d\n", *pd, *(pd + 1), *(pd + 2), *(pd + 3), *(pd + 4));
}

